<script>
export default {
  created () {
    // 调用API从本地缓存中获取数据
    /*
     * 平台 api 差异的处理方式:  api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
     * 微信：mpvue === wx, mpvuePlatform === 'wx'
     * 头条：mpvue === tt, mpvuePlatform === 'tt'
     * 百度：mpvue === swan, mpvuePlatform === 'swan'
     * 支付宝(蚂蚁)：mpvue === my, mpvuePlatform === 'my'
     */

    let logs
    if (mpvuePlatform === 'my') {
      logs = mpvue.getStorageSync({key: 'logs'}).data || []
      logs.unshift(Date.now())
      mpvue.setStorageSync({
        key: 'logs',
        data: logs
      })
    } else {
      logs = mpvue.getStorageSync('logs') || []
      logs.unshift(Date.now())
      mpvue.setStorageSync('logs', logs)
    }
  },
  log () {
    console.log(`log at:${Date.now()}`)
  }
}
</script>

<style>
  /**app.wxss**/
  /*@import "colorui/main.wxss";*/
  /*@import "colorui/icon.wxss";*/
  ::-webkit-scrollbar{

    /*height: 10rpx;*/
    /*background-color: #fff;*/
    color: transparent;
    height: 0;
    width: 0;
  }
  ::-webkit-scrollbar-track{

    border-radius: 10px  ;
    background-color: #fff;
  }
  /*定义滑块 内阴影+圆角*/
  ::-webkit-scrollbar-thumb{

    border-radius: 10px ;
    background-color: #49B152;
  }
  /*::-webkit-scrollbar-track-piece{*/

  /*}*/

</style>
